#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;
const int MOD = 998244353;

int n, m;
ll a[N];
ll f[N][15];
ll p[15];
ll c[15][15];
void init() {
  c[0][0] = 1;
  rep(i, 1, m) {
    c[i][0] = 1;
    rep(j, 1, i) c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % MOD;
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  rep(i, 1, n) cin >> a[i];
  init();
  f[1][0] = 1;
  rep(i, 1, n) {
    p[0] = 1;
    rep(j, 1, m) p[j] = p[j - 1] * a[i] % MOD;
    rep(j, 0, m) {
      f[i][j] = i * p[j] % MOD;
      rep(k, 1, j) f[i][j] =
          (f[i][j] + c[j][k] * p[j - k] % MOD * f[i - 1][k] % MOD) % MOD;
    }
  }
  ll sum = 0;
  rep(i, 1, n) sum = (sum + f[i][m]) % MOD;
  cout << sum;
  return 0;
}